package com.tongtong.stsuserapi.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
@ApiModel("订单")
@TableName("orders")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Order implements Serializable {
	private static final long serialVersionUID = 25322523L;

	@ApiModelProperty("ID主键")
	@TableId(value = "id", type = IdType.ASSIGN_ID)
	private Long id;

	@ApiModelProperty("创建时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;
	@ApiModelProperty("预定数量")
	private Integer itemCount;
	@ApiModelProperty("商品单价")
	private double itemPrice; //商品单价 总价交给前端计算
	@ApiModelProperty("逻辑删除 (0为删除,1为正常)")
	private Integer state;
	@ApiModelProperty("订单状态(1为创建,2为完成,3为取消)")
	private Integer orderState;

	@ApiModelProperty("商品id")
	private Long itemId;
	@ApiModelProperty("买家id")
	private Long userId;
	@ApiModelProperty("卖id")
	private Long sellerId;

	@ApiModelProperty("取消原因")
	private String cancelReason;
	@ApiModelProperty("取消时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date cancelTime;
	@ApiModelProperty("完成时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date completeTime;

}
